export function log(message: any) {
  console.log('%c%s', 'color: green;', '[app-front] ' + message);
}

/**
 * 返回顶部功能  主要用于翻页时
 */
export function BackToTop() {
  const scrollDom = document.getElementsByClassName("ant-layout-content")[0];
  if (!scrollDom) return;
  let distance = scrollDom.scrollTop;

  if (distance === 0) return;
  const timer = setInterval(() => {
    distance -= 500;
    document.getElementsByClassName("ant-layout-content")[0].scrollTop = distance;
    if (distance <= 0) {
      clearInterval(timer);
    }
  }, 50);
}


